<%@page import="nl.hva.web.mvcwebapp.controllers.UserController"%>
<%@page import="java.util.ArrayList"%>
<%@include file="/WEB-INF/templates/configuration.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="windows-1252"%>

<!--  **************** Multi Language ******************** -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
    session = request.getSession(true);
    String lang = (String) session.getAttribute("lang");
    if (lang == null) {
        //default language if language not set.
        lang = "en";
    }
%>
<fmt:setLocale value="<%=lang%>" />
<fmt:setBundle basename="<%=lang%>" />
<!--  **************** Multi Language END ******************** -->

<h2><fmt:message key="register-title"/></h2>
<hr/>
<c:if test="${not empty foutMelding}">
    <!-- Mochten er foutmeldingen zijn, dan worden ze hier getoond -->
    <p>${foutMelding}</p>
</c:if>
<p>
<form name="f1" id="nieuweGebruiker" action="register" method="post">
    <table border="0">
        <tr>
            <td style="width: 350px"><label for="error123"><font color="#FF0000" size="2">${validationError[0] eq ""? "":validationError[0]}</font></label></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[1] eq ""? "":validationError[1]}</font></label></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[2] eq ""? "":validationError[2]}</font></label></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[11] eq ""? "":validationError[11]}</font></label></td>
        </tr>
        <tr>
            <td><label for="username"><fmt:message key="uname"/>*</label></td>
            <td><input type="textfield" id="username" name="username" value="${userFail.userName}"></input></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[3] eq ""? "":validationError[3]}</font></label></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[4] eq ""? "":validationError[4]}</font></label></td>
        </tr>
        <tr>
            <td><label for="password"><fmt:message key="password"/>*</label></td>
            <td><input type="password" id="password" name="password" value="${userFail.password}"></input></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[5] eq ""? "":validationError[5]}</font></label></td>
        </tr>
        <tr>
            <td><label for="password-repeat"><fmt:message key="passwordCon"/>*</label></td>
            <td><input type="password" id="password2" name="password2" value="${userFail.password2}"></input></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[6] eq ""? "":validationError[6]}</font></label></td>
        </tr>
        <tr>
            <td><label for="firstname"><fmt:message key="fname"/>*</label></td>
            <td><input type="textfield" id="firstname" name="firstname" value="${userFail.userFirstName}"></input></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[7] eq ""? "":validationError[7]}</font></label></td>
        </tr>
        <tr>
            <td><label for="lastname"><fmt:message key="lname"/>*</label></td>
            <td><input type="textfield" id="lastname" name="lastname" value="${userFail.userLastName}"></input></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[8] eq ""? "":validationError[8]}</font></label></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[9] eq ""? "":validationError[9]}</font></label></td>
        </tr>
        <tr>
            <td><label for="email"><fmt:message key="email"/>*</label></td>
            <td><input type="textfield" id="email" name="email" value="${userFail.userEmail}"></input></td>
        </tr>
        <tr>
            <td><label for="error123"><font color="#FF0000" size="2">${validationError[10] eq ""? "":validationError[10]}</font></label></td>
        </tr>
        <tr>
            <td> <label for="landOfOrigin"><fmt:message key="landoforigin"/>:</label></td>
            <td>
                <select name="landOfOrigin">
                    <option value="1">The Netherlands</option>
                    <option value="2">England</option>
                    <option value="3">Other... (Language set to English)</option>
                </select>
            </td>
        </tr>
        <input type="hidden" name="usertype" id="usertype" value="1"></input>
        <tr>
            <td><label for="profilepicture"><fmt:message key="profilepicture"/></label></td>
            <td><input name="file" type="file" id="file"><td>
        </tr>
        <tr>
            <td><label for="asterix">*<i><fmt:message key="requiredF"/></i></label></td>
            <td><hr/><input class="submit button" type="submit" value="<fmt:message key="signUp"/>"></td>
        </tr>
    </table>
</p>
</form>